package jpa.entitys.promis.common;

import java.io.Serializable;

import javax.persistence.*;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the INVOICE database table.
 * 
 */
@Entity
@Table(name="INVOICE")
@NamedQueries({
    @NamedQuery(name = "Invoice.findAll", query = " SELECT c FROM Invoice c "),
    @NamedQuery(name = "Invoice.findById", query = " SELECT c FROM Invoice c WHERE c.id = :Id "),
    @NamedQuery(name = "Invoice.findByStatus", query = " SELECT c FROM Invoice c WHERE c.syncIssync = 'N'"),
})
public class Invoice extends jpa.entitys.common.CommonEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@EmbeddedId
	private InvoicePK id;
	
	@Override public String toString() { return org.apache.commons.lang.builder.ToStringBuilder.reflectionToString(this);}

	@Column(name="ADV_ADJUST", precision=22)
	private BigDecimal advAdjust;

	@Column(name="ADV_AMOUNT", precision=16, scale=2)
	private BigDecimal advAmount;

	@Column(name="ADVANCE_DEPOSIT", length=1)
	private String advanceDeposit;

	@Column(name="AR_NO", precision=6)
	private BigDecimal arNo;

	@Column(name="AR_SERIES", length=4)
	private String arSeries;

	@Column(name="AR_TYPE", length=2)
	private String arType;

	@Column(name="BUILDING_PHASE_CODE", length=30)
	private String buildingPhaseCode;

	@Column(name="CONTR_REQUEST_NO", precision=22)
	private BigDecimal contrRequestNo;

	@Column(name="CONTRACT_NO", precision=6)
	private BigDecimal contractNo;

	@Column(name="CONTRACT_SEQ_NO", precision=6)
	private BigDecimal contractSeqNo;

	@Column(name="CONTRACT_SERIES", length=4)
	private String contractSeries;

	@Column(name="CREATED_BY")
	private String createdBy;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="CREATED_ON")
	private Date createdOn;

	@Column(name="CREDIT_PERIOD", precision=3)
	private BigDecimal creditPeriod;

	@Column(name="CUM_CRNOTE_NET_VALUE", precision=16, scale=2)
	private BigDecimal cumCrnoteNetValue;

	@Column(name="CUM_CRNOTE_VAT_VALUE", precision=16, scale=2)
	private BigDecimal cumCrnoteVatValue;

	@Column(length=5)
	private String currency;

	@Column(name="CUSTOMER_ADDRESS_CODE", precision=2)
	private BigDecimal customerAddressCode;

	@Column(name="CUSTOMER_CODE", length=8)
	private String customerCode;

	@Column(name="CUSTOMER_NAME", length=70)
	private String customerName;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="DUE_DATE")
	private Date dueDate;

	@Column(name="EXCHANGE_RATE", precision=16, scale=2)
	private BigDecimal exchangeRate;

	@Column(name="FLOOR_ZONE_CODE", length=30)
	private String floorZoneCode;

	@Column(name="GEN_NUMBER", precision=6)
	private BigDecimal genNumber;

	@Column(name="GEN_PEN_NUMBER", precision=6)
	private BigDecimal genPenNumber;

	@Column(name="GEN_PEN_SERIES", length=4)
	private String genPenSeries;

	@Column(name="GEN_PEN_TYPE", length=2)
	private String genPenType;

	@Column(name="GEN_PENALTY_FLAG", length=2)
	private String genPenaltyFlag;

	@Column(name="GEN_SERIES", length=4)
	private String genSeries;

	@Column(name="GEN_TYPE", length=2)
	private String genType;

	@Column(name="INVOICE_AMOUNT", precision=16, scale=2)
	private BigDecimal invoiceAmount;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="INVOICE_DATE")
	private Date invoiceDate;

	@Column(name="INVOICE_WHT_FLAG", length=1)
	private String invoiceWhtFlag;

	@Column(name="INVOICING_TYPE", length=1)
	private String invoicingType;

	@Column(name="LAST_UPD_BY")
	private String lastUpdBy;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="LAST_UPD_ON")
	private Date lastUpdOn;

	@Column(name="METER_NUMBER")
	private String meterNumber;

	@Column(name="METER_TYPE", length=2)
	private String meterType;

	@Column(name="NET_INVOICE", precision=16, scale=2)
	private BigDecimal netInvoice;

	@Column(name="PAGE_GROUP")
	private String pageGroup;

	@Column(name="PAYMENT_RECEIVED", precision=16, scale=2)
	private BigDecimal paymentReceived;

	@Column(name="PAYMENT_REF_BANK", precision=22)
	private BigDecimal paymentRefBank;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="POSTING_DATE")
	private Date postingDate;

	@Column(length=30)
	private String project;

	@Column(name="PROPERTY_TYPE_CODE", length=1)
	private String propertyTypeCode;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="REF_INVOICE_DATE")
	private Date refInvoiceDate;

	@Column(name="REF_INVOICE_NO", precision=6)
	private BigDecimal refInvoiceNo;

	@Column(name="REF_INVOICE_SERIES", length=4)
	private String refInvoiceSeries;

	@Column(name="REF_INVOICE_TYPE", length=2)
	private String refInvoiceType;

	@Column(name="REF_NO", precision=22)
	private BigDecimal refNo;

	@Column(name="REF_REVISION", precision=22)
	private BigDecimal refRevision;

	@Column(name="REF_ROWID", length=18)
	private String refRowid;

	@Column(name="REF_SAPB1_INV", precision=22)
	private BigDecimal refSapb1Inv;

	@Column(name="REF_SERIES", length=30)
	private String refSeries;

	@Column(name="REF_TYPE", length=30)
	private String refType;

	@Column(length=300)
	private String remarks;

	@Column(name="SBO_ENTRY", precision=10)
	private BigDecimal sboEntry;

	@Column(name="SBO_INVOICE", precision=10)
	private BigDecimal sboInvoice;

	@Column(name="SERVICE_VAT_FLAG", length=1)
	private String serviceVatFlag;

	@Column(length=1)
	private String status;

	@Column(name="SYNC_CREATEDBY", length=100)
	private String syncCreatedby;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="SYNC_CREATEDON")
	private Date syncCreatedon;

	@Column(name="SYNC_EXTERNAL_REF_KEY", length=100)
	private String syncExternalRefKey;

	@Column(name="SYNC_EXTERNAL_REF_NO", length=100)
	private String syncExternalRefNo;

	@Column(name="SYNC_ISSTAGING", length=1)
	private String syncIsstaging;

	@Column(name="SYNC_ISSYNC", length=1)
	private String syncIssync;

	@Column(name="SYNC_UPDATEDBY", length=100)
	private String syncUpdatedby;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="SYNC_UPDATEDON")
	private Date syncUpdatedon;

	@Column(name="TEMPLATE_CODE", length=30)
	private String templateCode;

	@Column(name="TERM_OF_PAYMENT", length=5)
	private String termOfPayment;

	@Column(name="TRANSFER_B1_LOG", length=1)
	private String transferB1Log;

	@Column(name="TYPE_OF_CONTRACT", length=2)
	private String typeOfContract;

	@Column(name="TYPE_OF_INVOICE", length=1)
	private String typeOfInvoice;

	@Column(name="UNIT_NUMBER", length=30)
	private String unitNumber;

	@Column(precision=5, scale=2)
	private BigDecimal vat;

	@Column(name="VAT_AMOUNT", precision=16, scale=2)
	private BigDecimal vatAmount;

	@Column(name="VAT_CODE", length=2)
	private String vatCode;

	@Column(name="VAT_RECEIVED", precision=16, scale=2)
	private BigDecimal vatReceived;

	@Column(precision=5, scale=2)
	private BigDecimal wht;

	@Column(name="WHT_AMOUNT", precision=16, scale=2)
	private BigDecimal whtAmount;

	@Column(name="WHT_CODE", length=2)
	private String whtCode;

	//bi-directional many-to-one association to InvoiceDetail
	@OneToMany(mappedBy="invoice")
	private Set<InvoiceDetail> invoiceDetails;

	@Column(name="IS_INTERFACE")
	private String isInterface;

	public String getIsInterface() {
		return isInterface;
	}

	public void setIsInterface(String isInterface) {
		this.isInterface = isInterface;
	}
	
    public Invoice() {
    }

	public InvoicePK getId() {
		return this.id;
	}

	public void setId(InvoicePK id) {
		this.id = id;
	}
	
	public BigDecimal getAdvAdjust() {
		return this.advAdjust;
	}

	public void setAdvAdjust(BigDecimal advAdjust) {
		this.advAdjust = advAdjust;
	}

	public BigDecimal getAdvAmount() {
		return this.advAmount;
	}

	public void setAdvAmount(BigDecimal advAmount) {
		this.advAmount = advAmount;
	}

	public String getAdvanceDeposit() {
		return this.advanceDeposit;
	}

	public void setAdvanceDeposit(String advanceDeposit) {
		this.advanceDeposit = advanceDeposit;
	}

	public BigDecimal getArNo() {
		return this.arNo;
	}

	public void setArNo(BigDecimal arNo) {
		this.arNo = arNo;
	}

	public String getArSeries() {
		return this.arSeries;
	}

	public void setArSeries(String arSeries) {
		this.arSeries = arSeries;
	}

	public String getArType() {
		return this.arType;
	}

	public void setArType(String arType) {
		this.arType = arType;
	}

	public String getBuildingPhaseCode() {
		return this.buildingPhaseCode;
	}

	public void setBuildingPhaseCode(String buildingPhaseCode) {
		this.buildingPhaseCode = buildingPhaseCode;
	}

	public BigDecimal getContrRequestNo() {
		return this.contrRequestNo;
	}

	public void setContrRequestNo(BigDecimal contrRequestNo) {
		this.contrRequestNo = contrRequestNo;
	}

	public BigDecimal getContractNo() {
		return this.contractNo;
	}

	public void setContractNo(BigDecimal contractNo) {
		this.contractNo = contractNo;
	}

	public BigDecimal getContractSeqNo() {
		return this.contractSeqNo;
	}

	public void setContractSeqNo(BigDecimal contractSeqNo) {
		this.contractSeqNo = contractSeqNo;
	}

	public String getContractSeries() {
		return this.contractSeries;
	}

	public void setContractSeries(String contractSeries) {
		this.contractSeries = contractSeries;
	}

	public String getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public Date getCreatedOn() {
		return this.createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}

	public BigDecimal getCreditPeriod() {
		return this.creditPeriod;
	}

	public void setCreditPeriod(BigDecimal creditPeriod) {
		this.creditPeriod = creditPeriod;
	}

	public BigDecimal getCumCrnoteNetValue() {
		return this.cumCrnoteNetValue;
	}

	public void setCumCrnoteNetValue(BigDecimal cumCrnoteNetValue) {
		this.cumCrnoteNetValue = cumCrnoteNetValue;
	}

	public BigDecimal getCumCrnoteVatValue() {
		return this.cumCrnoteVatValue;
	}

	public void setCumCrnoteVatValue(BigDecimal cumCrnoteVatValue) {
		this.cumCrnoteVatValue = cumCrnoteVatValue;
	}

	public String getCurrency() {
		return this.currency;
	}

	public void setCurrency(String currency) {
		this.currency = currency;
	}

	public BigDecimal getCustomerAddressCode() {
		return this.customerAddressCode;
	}

	public void setCustomerAddressCode(BigDecimal customerAddressCode) {
		this.customerAddressCode = customerAddressCode;
	}

	public String getCustomerCode() {
		return this.customerCode;
	}

	public void setCustomerCode(String customerCode) {
		this.customerCode = customerCode;
	}

	public String getCustomerName() {
		return this.customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public Date getDueDate() {
		return this.dueDate;
	}

	public void setDueDate(Date dueDate) {
		this.dueDate = dueDate;
	}

	public BigDecimal getExchangeRate() {
		return this.exchangeRate;
	}

	public void setExchangeRate(BigDecimal exchangeRate) {
		this.exchangeRate = exchangeRate;
	}

	public String getFloorZoneCode() {
		return this.floorZoneCode;
	}

	public void setFloorZoneCode(String floorZoneCode) {
		this.floorZoneCode = floorZoneCode;
	}

	public BigDecimal getGenNumber() {
		return this.genNumber;
	}

	public void setGenNumber(BigDecimal genNumber) {
		this.genNumber = genNumber;
	}

	public BigDecimal getGenPenNumber() {
		return this.genPenNumber;
	}

	public void setGenPenNumber(BigDecimal genPenNumber) {
		this.genPenNumber = genPenNumber;
	}

	public String getGenPenSeries() {
		return this.genPenSeries;
	}

	public void setGenPenSeries(String genPenSeries) {
		this.genPenSeries = genPenSeries;
	}

	public String getGenPenType() {
		return this.genPenType;
	}

	public void setGenPenType(String genPenType) {
		this.genPenType = genPenType;
	}

	public String getGenPenaltyFlag() {
		return this.genPenaltyFlag;
	}

	public void setGenPenaltyFlag(String genPenaltyFlag) {
		this.genPenaltyFlag = genPenaltyFlag;
	}

	public String getGenSeries() {
		return this.genSeries;
	}

	public void setGenSeries(String genSeries) {
		this.genSeries = genSeries;
	}

	public String getGenType() {
		return this.genType;
	}

	public void setGenType(String genType) {
		this.genType = genType;
	}

	public BigDecimal getInvoiceAmount() {
		return this.invoiceAmount;
	}

	public void setInvoiceAmount(BigDecimal invoiceAmount) {
		this.invoiceAmount = invoiceAmount;
	}

	public Date getInvoiceDate() {
		return this.invoiceDate;
	}

	public void setInvoiceDate(Date invoiceDate) {
		this.invoiceDate = invoiceDate;
	}

	public String getInvoiceWhtFlag() {
		return this.invoiceWhtFlag;
	}

	public void setInvoiceWhtFlag(String invoiceWhtFlag) {
		this.invoiceWhtFlag = invoiceWhtFlag;
	}

	public String getInvoicingType() {
		return this.invoicingType;
	}

	public void setInvoicingType(String invoicingType) {
		this.invoicingType = invoicingType;
	}

	public String getLastUpdBy() {
		return this.lastUpdBy;
	}

	public void setLastUpdBy(String lastUpdBy) {
		this.lastUpdBy = lastUpdBy;
	}

	public Date getLastUpdOn() {
		return this.lastUpdOn;
	}

	public void setLastUpdOn(Date lastUpdOn) {
		this.lastUpdOn = lastUpdOn;
	}

	public String getMeterNumber() {
		return this.meterNumber;
	}

	public void setMeterNumber(String meterNumber) {
		this.meterNumber = meterNumber;
	}

	public String getMeterType() {
		return this.meterType;
	}

	public void setMeterType(String meterType) {
		this.meterType = meterType;
	}

	public BigDecimal getNetInvoice() {
		return this.netInvoice;
	}

	public void setNetInvoice(BigDecimal netInvoice) {
		this.netInvoice = netInvoice;
	}

	public String getPageGroup() {
		return this.pageGroup;
	}

	public void setPageGroup(String pageGroup) {
		this.pageGroup = pageGroup;
	}

	public BigDecimal getPaymentReceived() {
		return this.paymentReceived;
	}

	public void setPaymentReceived(BigDecimal paymentReceived) {
		this.paymentReceived = paymentReceived;
	}

	public BigDecimal getPaymentRefBank() {
		return this.paymentRefBank;
	}

	public void setPaymentRefBank(BigDecimal paymentRefBank) {
		this.paymentRefBank = paymentRefBank;
	}

	public Date getPostingDate() {
		return this.postingDate;
	}

	public void setPostingDate(Date postingDate) {
		this.postingDate = postingDate;
	}

	public String getProject() {
		return this.project;
	}

	public void setProject(String project) {
		this.project = project;
	}

	public String getPropertyTypeCode() {
		return this.propertyTypeCode;
	}

	public void setPropertyTypeCode(String propertyTypeCode) {
		this.propertyTypeCode = propertyTypeCode;
	}

	public Date getRefInvoiceDate() {
		return this.refInvoiceDate;
	}

	public void setRefInvoiceDate(Date refInvoiceDate) {
		this.refInvoiceDate = refInvoiceDate;
	}

	public BigDecimal getRefInvoiceNo() {
		return this.refInvoiceNo;
	}

	public void setRefInvoiceNo(BigDecimal refInvoiceNo) {
		this.refInvoiceNo = refInvoiceNo;
	}

	public String getRefInvoiceSeries() {
		return this.refInvoiceSeries;
	}

	public void setRefInvoiceSeries(String refInvoiceSeries) {
		this.refInvoiceSeries = refInvoiceSeries;
	}

	public String getRefInvoiceType() {
		return this.refInvoiceType;
	}

	public void setRefInvoiceType(String refInvoiceType) {
		this.refInvoiceType = refInvoiceType;
	}

	public BigDecimal getRefNo() {
		return this.refNo;
	}

	public void setRefNo(BigDecimal refNo) {
		this.refNo = refNo;
	}

	public BigDecimal getRefRevision() {
		return this.refRevision;
	}

	public void setRefRevision(BigDecimal refRevision) {
		this.refRevision = refRevision;
	}

	public String getRefRowid() {
		return this.refRowid;
	}

	public void setRefRowid(String refRowid) {
		this.refRowid = refRowid;
	}

	public BigDecimal getRefSapb1Inv() {
		return this.refSapb1Inv;
	}

	public void setRefSapb1Inv(BigDecimal refSapb1Inv) {
		this.refSapb1Inv = refSapb1Inv;
	}

	public String getRefSeries() {
		return this.refSeries;
	}

	public void setRefSeries(String refSeries) {
		this.refSeries = refSeries;
	}

	public String getRefType() {
		return this.refType;
	}

	public void setRefType(String refType) {
		this.refType = refType;
	}

	public String getRemarks() {
		return this.remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public BigDecimal getSboEntry() {
		return this.sboEntry;
	}

	public void setSboEntry(BigDecimal sboEntry) {
		this.sboEntry = sboEntry;
	}

	public BigDecimal getSboInvoice() {
		return this.sboInvoice;
	}

	public void setSboInvoice(BigDecimal sboInvoice) {
		this.sboInvoice = sboInvoice;
	}

	public String getServiceVatFlag() {
		return this.serviceVatFlag;
	}

	public void setServiceVatFlag(String serviceVatFlag) {
		this.serviceVatFlag = serviceVatFlag;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getSyncCreatedby() {
		return this.syncCreatedby;
	}

	public void setSyncCreatedby(String syncCreatedby) {
		this.syncCreatedby = syncCreatedby;
	}

	public Date getSyncCreatedon() {
		return this.syncCreatedon;
	}

	public void setSyncCreatedon(Date syncCreatedon) {
		this.syncCreatedon = syncCreatedon;
	}

	public String getSyncExternalRefKey() {
		return this.syncExternalRefKey;
	}

	public void setSyncExternalRefKey(String syncExternalRefKey) {
		this.syncExternalRefKey = syncExternalRefKey;
	}

	public String getSyncExternalRefNo() {
		return this.syncExternalRefNo;
	}

	public void setSyncExternalRefNo(String syncExternalRefNo) {
		this.syncExternalRefNo = syncExternalRefNo;
	}

	public String getSyncIsstaging() {
		return this.syncIsstaging;
	}

	public void setSyncIsstaging(String syncIsstaging) {
		this.syncIsstaging = syncIsstaging;
	}

	public String getSyncIssync() {
		return this.syncIssync;
	}

	public void setSyncIssync(String syncIssync) {
		this.syncIssync = syncIssync;
	}

	public String getSyncUpdatedby() {
		return this.syncUpdatedby;
	}

	public void setSyncUpdatedby(String syncUpdatedby) {
		this.syncUpdatedby = syncUpdatedby;
	}

	public Date getSyncUpdatedon() {
		return this.syncUpdatedon;
	}

	public void setSyncUpdatedon(Date syncUpdatedon) {
		this.syncUpdatedon = syncUpdatedon;
	}

	public String getTemplateCode() {
		return this.templateCode;
	}

	public void setTemplateCode(String templateCode) {
		this.templateCode = templateCode;
	}

	public String getTermOfPayment() {
		return this.termOfPayment;
	}

	public void setTermOfPayment(String termOfPayment) {
		this.termOfPayment = termOfPayment;
	}

	public String getTransferB1Log() {
		return this.transferB1Log;
	}

	public void setTransferB1Log(String transferB1Log) {
		this.transferB1Log = transferB1Log;
	}

	public String getTypeOfContract() {
		return this.typeOfContract;
	}

	public void setTypeOfContract(String typeOfContract) {
		this.typeOfContract = typeOfContract;
	}

	public String getTypeOfInvoice() {
		return this.typeOfInvoice;
	}

	public void setTypeOfInvoice(String typeOfInvoice) {
		this.typeOfInvoice = typeOfInvoice;
	}

	public String getUnitNumber() {
		return this.unitNumber;
	}

	public void setUnitNumber(String unitNumber) {
		this.unitNumber = unitNumber;
	}

	public BigDecimal getVat() {
		return this.vat;
	}

	public void setVat(BigDecimal vat) {
		this.vat = vat;
	}

	public BigDecimal getVatAmount() {
		return this.vatAmount;
	}

	public void setVatAmount(BigDecimal vatAmount) {
		this.vatAmount = vatAmount;
	}

	public String getVatCode() {
		return this.vatCode;
	}

	public void setVatCode(String vatCode) {
		this.vatCode = vatCode;
	}

	public BigDecimal getVatReceived() {
		return this.vatReceived;
	}

	public void setVatReceived(BigDecimal vatReceived) {
		this.vatReceived = vatReceived;
	}

	public BigDecimal getWht() {
		return this.wht;
	}

	public void setWht(BigDecimal wht) {
		this.wht = wht;
	}

	public BigDecimal getWhtAmount() {
		return this.whtAmount;
	}

	public void setWhtAmount(BigDecimal whtAmount) {
		this.whtAmount = whtAmount;
	}

	public String getWhtCode() {
		return this.whtCode;
	}

	public void setWhtCode(String whtCode) {
		this.whtCode = whtCode;
	}

	public Set<InvoiceDetail> getInvoiceDetails() {
		return this.invoiceDetails;
	}

	public void setInvoiceDetails(Set<InvoiceDetail> invoiceDetails) {
		this.invoiceDetails = invoiceDetails;
	}
	
}